<!--
 * @Author: your name
 * @Date: 2021-08-06 14:22:10
 * @LastEditTime: 2021-08-06 14:38:42
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \briup\3-html&css\day05\1-伪类选择器.html
-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>伪类选择器</title>
    <style>
        /* .app>*:only-child {
                        color:steelblue;
        } */
        /* .app>*:first-child {
                        color:steelblue;
        } */
        /* 选中app类每种类型的第一个孩子元素  */
                   .app>*:first-of-type {
                        color:steelblue;
        }  
        /* 选中app类每种类型的倒数第一个孩子元素 */
        .app>*:last-of-type {
                        color:steelblue;
        }  
        选中app类每种类型的第一个孩子元素
        .app>*:nth-last-of-type(2) {
                        color:steelblue;
        }  
    </style>
</head>
<body>
    <div class="app">
        
          <div>123-9</div>
          <div>123-1</div>
        
          <div class="app">
          <div>456</div>
          <div>789</div>
        </div>
        <p>999</p>
    </div>
</body>
</html>